package com.wzg.appframe;

import android.app.Application;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;
import com.uuzuche.lib_zxing.activity.ZXingLibrary;
import com.wzg.appframe.action.BaseAction;
import com.wzg.appframe.action.InitAction;
import com.wzg.appframe.action.WebAction;
import com.wzg.appframe.utils.LogcatHelper;
import com.wzg.appframe.view.BaseActivity;
import com.wzg.appframe.web.local.LocalResInit;
import com.wzg.gprintlib.App;


public class TApplication extends Application {

    private static TApplication sInstance;

    // 建立请求队列
    public static RequestQueue queue;

    @Override
    public void onCreate() {
        super.onCreate();
        sInstance = this;
        queue = Volley.newRequestQueue(getApplicationContext());
        ZXingLibrary.initDisplayOpinion(this);

        LocalResInit.initResDir();
        LogcatHelper.getInstance(this).start();
        App.setContext(getApplicationContext());
    }

    public static TApplication getInstance() {
        return sInstance;
    }

    public static RequestQueue getHttpQueue() {
        return queue;
    }

    @Override
    public void onTerminate() {
        super.onTerminate();
        LogcatHelper.getInstance(this).stop();
    }
}
